//
//  ExclusiveDetailsectionSixViewController.m
//  Music
//
//  Created by dllo on 16/6/9.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ExclusiveDetailsectionSixViewController.h"

@interface ExclusiveDetailsectionSixViewController ()<UIWebViewDelegate>
@property(nonatomic,retain)UIWebView  *webView;
@property(nonatomic,retain)NSString  *str ;
@end

@implementation ExclusiveDetailsectionSixViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self  getSectionSix];
}
-(void)getSectionSix
{
    _str = @"http://www.xiami.com/market/music/act/asia-song-info.php?spm=a2z03.7728672.0.0.VI5Z27&id=2016-06-06&sid=1776165573&mv_id=&from=ttpod";
    self.webView = [[UIWebView  alloc]initWithFrame:CGRectMake(0, 0, Screenwidth, Screenheight)];
    self.webView.scrollView.bounces = NO;
    [self.webView  sizeToFit ];
    NSURLRequest  *request = [NSURLRequest  requestWithURL:[NSURL  URLWithString:_str]];
    [self.webView  loadRequest:request];
    self.webView.delegate = self;
    [self.view  addSubview:self.webView];
}
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    [webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('btn-albumComments-leave-comments').style.display = 'NONE'"];
    [webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByClassName('play-all')[0].style.display = 'NONE'"];
   
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    //判断是否是单击
    if (navigationType == UIWebViewNavigationTypeLinkClicked)
    {
        NSURL *url = [request URL];
        if([[UIApplication sharedApplication]canOpenURL:url])
        {
            [[UIApplication sharedApplication]openURL:url];
        }
        return NO;
    }
    return YES;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
